<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>3-参数查询</title>
</head>

<body>
  <!-- 
    城市列表：http://hmajax.itheima.net/api/city
    参数名：pname
    值：省份名字
  -->
  <p></p>

  <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js">
  </script>

  <script>
    axios({
      url:'http://hmajax.itheima.net/api/city',
      params:{
        pname:'湖南省'
      }
    }).then( result =>{
      console.log(result);
      console.log(result.data.list);
      document.querySelector('p').innerHTML = result.data.list.join('<br>')
    })
  </script>

</body>
</html>